<template>
	<view class="container">
		<view class="flex diygw-col-24 justify-start flex-nowrap flex2-clz">
			<view class="flex diygw-col-3 avatar3-clz">
				<view @tap="navigateTo" data-type="page" data-url="/pages/my/qiyejiagerenzhongxin" class="diygw-avatar sm white radius">
					<text class="diy-icon-back_android"></text>
				</view>
			</view>
			<view class="diygw-col-0 text6-clz"> 我的关注 </view>
		</view>
		<view class="flex diygw-col-24 flex-direction-column">
			<view class="diygw-tabs text-center solid-bottom justify-center scale-title small-border">
				<view class="diygw-tab-item" :class="index == tabs1Index ? ' cur text-green ' : ''" v-for="(item, index) in tabs1Datas" :key="index" @click="changeTabs1" :data-index="index"> <text v-if="item.icon" :class="item.icon"></text> {{ item.text }} </view>
			</view>
			<view class="">
				<view v-if="tabs1Index == 0" class="flex-sub">
					<view v-for="(item, index) in business.data.list" :key="index" class="flex diygw-col-24 justify-start flex-nowrap flex4-clz" @tap="navigateTo" data-type="page" data-url="/pages/index/qiyejiaxiangqing">
						<view class="flex diygw-col-0 justify-start">
							<view v-for="(item, index) in business.data.list[0].pic_" :key="index" class="diygw-avatar xs radius bg-none">
								<image mode="aspectFit" class="diygw-avatar-img radius" :src="item.pic_"></image>
							</view>
						</view>
						<view class="flex flex-wrap diygw-col-24 flex-direction-column justify-center flex6-clz">
							<view class="flex flex-wrap diygw-col-0 justify-start flex8-clz">
								<view class="diygw-col-0">
									{{ item.user_name_ }}
								</view>
								<view class="diygw-col-0 text9-clz"> 已帮扶5家企业 </view>
							</view>
							<view class="flex diygw-col-0 justify-start items-center flex-nowrap flex5-clz">
								<view class="flex flex-wrap diygw-col-0 flex10-clz">
									<view class="diygw-col-0"> 公司企业名称： </view>
									<view class="diygw-col-0">
										{{ item.bus_name_ }}
									</view>
								</view>
							</view>
							<view class="flex diygw-col-0 justify-start items-center flex-nowrap flex1-clz">
								<view class="diygw-col-0"> 管理时长： </view>
								<view class="diygw-col-0">
									{{ item.manage_time_ }}
								</view>
							</view>
							<view v-for="(item, index) in businessScore.data.list" :key="index" class="flex diygw-col-0 justify-start items-center flex-nowrap flex-clz">
								<view class="diygw-col-0"> 资金评分： </view>
								<view class="diygw-col-0">
									{{ item.cash_ }}
								</view>
							</view>
						</view>
						<view class="flex diygw-col-0 justify-end items-end flex-nowrap flex37-clz">
							<view class="flex diygw-col-0 justify-end avatar1-clz">
								<view class="diygw-avatar xs radius">
									<text class="diy-icon-commentfill"></text>
								</view>
							</view>
							<view class="diygw-col-0 text2-clz"> 256 </view>
						</view>
					</view>
				</view>
				<view v-if="tabs1Index == 1" class="flex-sub">
					<view v-for="(item, index) in project.data.list" :key="index" class="flex diygw-col-24 justify-around flex-nowrap flex3-clz" @tap="navigateTo" data-type="page" data-url="/pages/youxuanxiangmu/xiangmuxiangqing">
						<view class="flex flex-wrap diygw-col-0 justify-between flex9-clz">
							<view class="flex diygw-col-0 justify-center">
								<view v-for="(item, index) in project.data.list[0].picture_" :key="index" class="diygw-avatar sm radius bg-none">
									<image mode="aspectFit" class="diygw-avatar-img radius" :src="item.picture_"></image>
								</view>
							</view>
						</view>
						<view class="flex diygw-col-24 flex-direction-column justify-start flex-wrap flex12-clz">
							<view class="flex flex-wrap diygw-col-0 flex14-clz">
								<view class="diygw-col-0 text1-clz">
									{{ item.project_name_ }}
								</view>
								<view class="diygw-col-0">
									{{ item.project_type_ }}
								</view>
							</view>
							<view class="flex flex-wrap diygw-col-24 flex-direction-column flex16-clz">
								<view v-for="(item, index) in projectNeed.data.list" :key="index" class="flex flex-wrap diygw-col-0 flex18-clz">
									<view class="diygw-col-0 text8-clz">
										{{ item.need_type_ }}
									</view>
									<view class="diygw-col-0">
										{{ item.need_value_ }}
									</view>
								</view>
								<view v-for="(item, index) in projectNeed.data.list" :key="index" class="flex flex-wrap diygw-col-0 flex20-clz">
									<view class="diygw-col-0 text16-clz">
										{{ item.need_detail_ }}
									</view>
									<view class="diygw-col-0">
										{{ item.detail_value_ }}
									</view>
								</view>
							</view>
						</view>
						<view class="flex diygw-col-0 justify-end items-end flex-nowrap flex22-clz">
							<view class="flex diygw-col-0 justify-end avatar6-clz">
								<view class="diygw-avatar xs radius">
									<text class="diy-icon-commentfill"></text>
								</view>
							</view>
							<view class="diygw-col-0 text22-clz"> 256 </view>
						</view>
					</view>
				</view>
			</view>
		</view>
		<view class="clearfix"></view>
	</view>
</template>

<script>
	//create by: 邓志锋 <280160522@qq.com> <https://www.diygw.com> DIYGW可视化设计一键生成源码
	export default {
		data() {
			return {
				//用户全局信息
				userInfo: {},
				business: {
					code: '200',
					data: {
						count: 2,
						list: [
							{
								bus_own_: '地方收费多少',
								user_phone_: '13131313',
								pic_: './image',
								bus_resource_: '资源',
								status_: '审核通过',
								user_name_: '佳佳',
								id_: '434437408591446017',
								bus_name_: '测试企业',
								bus_type_: '制造业',
								bus_desc_: '测试企业',
								manage_time_: '6'
							},
							{
								bus_own_: 'nn',
								user_phone_: '2332',
								pic_: './image',
								bus_resource_: '资源',
								status_: '审核不通过',
								user_name_: 'ww',
								id_: '434437408591446018',
								bus_name_: '测试2',
								bus_type_: '食品业',
								bus_desc_: '测试',
								manage_time_: '7'
							}
						]
					},
					isOk: true
				},
				businessScore: {
					code: '200',
					data: {
						count: 1,
						list: [
							{
								experience_: '9',
								user_id_: '434443977751527426',
								user_name_: '222',
								id_: '1',
								bus_name_: '测试企业',
								cash_: '9',
								resource_: '9',
								bus_id_: '434437408591446017'
							}
						]
					},
					isOk: true
				},
				project: {
					code: '200',
					data: {
						count: 5,
						list: [
							{
								project_type_: '人才',
								user_phone_: '111',
								user_name_: '111',
								id_: '434440356570595329',
								project_status: '优选发布',
								picture_: '111',
								project_desc_: '好项目',
								project_name_: '作业帮'
							},
							{
								project_type_: '人才',
								user_phone_: '123',
								user_name_: '123',
								id_: '434554158620868609',
								project_status: '成交',
								picture_: '123',
								project_desc_: '真好喝',
								project_name_: '汇源果汁'
							},
							{
								project_type_: '人才',
								user_phone_: 'www',
								user_name_: 'www',
								id_: '434559619204907009',
								project_status: '优选发布',
								picture_: 'www',
								project_desc_: 'www',
								project_name_: 'www'
							},
							{
								project_type_: '222',
								user_phone_: '222',
								user_name_: '222',
								id_: '434559717528043521',
								project_status: '222',
								picture_: '222',
								project_desc_: '222',
								project_name_: '222'
							},
							{
								project_type_: '人才',
								user_phone_: '111',
								user_name_: '111',
								id_: '434559825713037313',
								project_status: '成交',
								picture_: '111',
								project_desc_: '111',
								project_name_: '111'
							}
						]
					},
					isOk: true
				},
				projectNeed: {
					code: '200',
					data: {
						count: 3,
						list: [
							{
								project_id_: '434440356570595329',
								detail_value_: '111',
								id_: '434443070963187713',
								need_type_: '111',
								need_detail_: '',
								project_name_: '作业帮',
								need_value_: ''
							},
							{
								project_id_: '434559619204907009',
								detail_value_: '111',
								id_: '434559619205169153',
								need_type_: 'www',
								need_detail_: '',
								project_name_: 'www',
								need_value_: ''
							},
							{
								project_id_: '434559825713037313',
								detail_value_: '111',
								id_: '434559825713037321',
								need_type_: '111',
								need_detail_: '',
								project_name_: '111',
								need_value_: ''
							}
						]
					},
					isOk: true
				},
				tabs1Datas: [
					{ text: `企业家`, icon: `` },
					{ text: `创业项目`, icon: `` }
				],
				tabs1Index: 0
			};
		},
		onShow() {
			this.setCurrentPage(this);
		},
		onLoad(option) {
			this.setCurrentPage(this);
			if (option) {
				this.setData({
					globalOption: this.getOption(option)
				});
			}

			this.init();
		},
		methods: {
			async init() {
				await this.businessApi();
				await this.businessScoreApi();
				await this.projectApi();
				await this.projectNeedApi();
			},
			// 企业家接口 API请求方法
			async businessApi() {
				let business = await this.$http.post(
					'https://agent.diygw.com/',
					{
						url: '/form/formCustSql/view/liststr_businessList',
						method: 'post',
						headers: {
							'Content-Type': 'application/x-www-form-urlencoded'
						},
						param: '{"curPage":1,"pageSize":"10","params":{}}'
					},
					{
						'Content-type': 'application/json'
					},
					'json'
				);
				this.business = business;
			},
			// 企业家评分 API请求方法
			async businessScoreApi() {
				let businessScore = await this.$http.post(
					'https://agent.diygw.com/',
					{
						url: '/form/formCustSql/view/liststr_businessScore',
						method: 'post',
						headers: {
							'Content-Type': 'application/x-www-form-urlencoded'
						},
						param: '{"curPage":1,"pageSize":"10","params":"{"timestamp":"1660029492549"}"}'
					},
					{
						'Content-type': 'application/json'
					},
					'json'
				);
				this.businessScore = businessScore;
			},
			// 项目接口 API请求方法
			async projectApi() {
				let project = await this.$http.post(
					'https://agent.diygw.com/',
					{
						url: '/form/formCustSql/view/liststr_projectList',
						method: 'post',
						headers: {
							'Content-Type': 'application/x-www-form-urlencoded'
						},
						param: '{"curPage":1,"pageSize":"10","params":"{"timestamp":"1660024898338"}"}'
					},
					{
						'Content-type': 'application/json'
					},
					'json'
				);
				this.project = project;
			},
			// 项目需求接口 API请求方法
			async projectNeedApi() {
				let projectNeed = await this.$http.post(
					'https://agent.diygw.com/',
					{
						url: '/form/formCustSql/view/liststr_projectNeed  ',
						method: 'post',
						headers: {
							'Content-Type': 'application/x-www-form-urlencoded'
						},
						param: '{"curPage":1,"pageSize":"10","params":"{"timestamp":"1659935895655"}"}'
					},
					{
						'Content-type': 'application/json'
					},
					'json'
				);
				this.projectNeed = projectNeed;
			},
			changeTabs1(evt) {
				let { index } = evt.currentTarget.dataset;
				if (index == this.tabs1Index) return;
				this.setData({
					tabs1Index: index
				});
			}
		}
	};
</script>

<style lang="scss" scoped>
	.flex2-clz {
		box-shadow: 0px 3px 3px rgba(31, 31, 31, 0.16) inset;
		overflow: hidden;
		flex: 1;
		border-bottom: 3px solid #eee;
	}
	.avatar3-clz {
		margin-left: 10px;
		font-weight: bold;
		width: calc(12.5% - 10px - 5px) !important;
		font-size: 16px;
		margin-top: 10px;
		margin-bottom: 5px;
		margin-right: 5px;
	}
	.text6-clz {
		margin-left: 100px;
		padding-top: 10px;
		font-weight: bold;
		padding-left: 0px;
		font-size: 15px;
		padding-bottom: 0px;
		margin-top: 5px;
		margin-bottom: 5px;
		text-align: center;
		margin-right: 5px;
		padding-right: 0px;
	}
	.flex4-clz {
		margin-left: 8px;
		border: 1px solid #eee;
		padding-top: 5px;
		box-shadow: 0px 1px 3px rgba(31, 31, 31, 0.16);
		overflow: hidden;
		padding-left: 5px;
		width: calc(100% - 8px - 5px) !important;
		padding-bottom: 5px;
		margin-top: 10px;
		margin-bottom: 5px;
		margin-right: 5px;
		padding-right: 5px;
	}
	.text9-clz {
		text-align: right;
	}
	.avatar1-clz {
		margin-left: 5px;
		background-size: 100% 100%;
		margin-top: 15px;
		margin-bottom: 5px;
		margin-right: 0px;
	}
	.text2-clz {
		margin-left: 5px;
		margin-top: 5px;
		margin-bottom: 10px;
		margin-right: 5px;
	}
	.flex12-clz {
		margin-left: 15px;
		width: calc(100% - 15px - 5px) !important;
		margin-top: 5px;
		margin-bottom: 5px;
		margin-right: 5px;
	}
	.text1-clz {
		font-weight: bold;
	}
	.text8-clz {
		font-weight: bold;
	}
	.text16-clz {
		font-weight: bold;
	}
	.avatar6-clz {
		margin-left: 5px;
		background-size: 100% 100%;
		margin-top: 15px;
		margin-bottom: 5px;
		margin-right: 0px;
	}
	.text22-clz {
		margin-left: 5px;
		margin-top: 5px;
		margin-bottom: 10px;
		margin-right: 5px;
	}
	.container {
		padding-left: 0px;
		padding-right: 0px;

		font-size: 12px;
	}
	.container {
	}
</style>
